<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8" />
  <title>用户登录</title>
  <meta name="description" content="app, web app, responsive, responsive layout, admin, admin panel, admin dashboard, flat, flat ui, ui kit, AngularJS, ui route, charts, widgets, components" />
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
  <link rel="stylesheet" href="{{ asset('resources/admin/plugins/bootstrap/css/bootstrap.css') }}" />
  <link rel="stylesheet" href="{{ asset('resources/admin/plugins/font-awesome/css/font-awesome.min.css') }}" />
  <link rel="stylesheet" href="{{ asset('resources/admin/css/roboto.css') }}" />
  <link rel="stylesheet" href="{{ asset('resources/admin/css/login.css') }}" />
</head>
<body>
  <div class="top-content">
    <div class="inner-bg">
      <div class="container">
        <div class="row">
          <div class="col-sm-6 col-sm-offset-3 form-box">
            <div class="form-top">
              <div class="form-top-left">
                <h3>登录</h3>
                <p>输入您的账户信息登录</p>
              </div>
              <div class="form-top-right">
                <i class="fa fa-key"></i>
              </div>
            </div>
            <div class="form-bottom">
              <form data-role="login-form" action="{{ admin_action('Auth\AuthController@postLogin') }}" method="post" class="login-form">
                {{ csrf_field() }}
                <div class="form-group {{ $errors->has('username') ? 'has-error' : '' }}">
                  <label class="sr-only" for="form-username">用户名</label>
                  <input type="text" name="username" value="{{ old('username') }}" placeholder="请输入用户名" class="form-username form-control" data-rule-required="true">
                
                  @if ($errors->has('username'))
                  <span class="help-block error">{{ $errors->first('username') }}</span>
                  @endif
                </div>
                <div class="form-group  {{ $errors->has('password') ? 'has-error' : '' }}">
                  <label class="sr-only" for="form-password">密码</label>
                  <input type="password" name="password" placeholder="请输入密码" class="form-password form-control" data-rule-required="true">

                  @if ($errors->has('password'))
                  <span class="help-block error">{{ $errors->first('password') }}</span>
                  @endif
                </div>

                <!-- <div class="form-group">
                  <div class="row">
                    <div class="col-sm-5 {{$errors->has('captcha') ? 'has-error' : '' }}">
                      <label class="sr-only" for="form-captcha">验证码</label>
                      <input type="text" name="captcha" placeholder="请输入验证码" class="form-control col-sm-4" data-rule-required="true">
                      @if ($errors->has('captcha'))
                      <span class="help-block error">{{ $errors->first('captcha') }}</span>
                      @endif
                    </div>
                    <div class="col-sm-7">
                        <img src="{{ captcha_src('flat') }}" alt="captcha" class="captcha-img" data-refresh-url="">
                    </div>
                  </div>
                </div> -->
                <button type="submit" class="btn">登&nbsp;录</button>
              </form>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
  <script src="{{ asset('resources/admin/plugins/jquery/jquery.min.js') }}"></script>
  <script src="{{ asset('resources/admin/plugins/bootstrap/js/bootstrap.min.js') }}"></script>
  <script src="{{ asset('resources/admin/plugins/jquery.validate/jquery.validate.min.js') }}"></script>
  <script src="{{ asset('resources/admin/plugins/jquery.validate/localization/messages_zh.js') }}"></script>
  <script type="text/javascript">
    $(function() {
      $('[data-role=login-form]').validate({
        errorElement: 'span',
        errorPlacement: function(error, element) {
          $(element).parent().find('.help-block.error').remove();
          element.parent().removeClass('has-success').addClass('has-error');
          error.addClass('help-block').insertAfter(element);
        },
        success: function(label, element) {
          $(element).parent().find('.help-block.error').remove();
          $(element).parent().removeClass('has-error').addClass('has-success');
        }
      });

      $('img.captcha-img').on('click', function () {
        var captcha = $(this);
        var url = captcha.data('refresh-url');

        $.ajax({
            method: 'GET',
            url: url,
        }).done(function (response) {
            captcha.prop('src', response);
        });
      });
    });
  </script>
</body>
</html>